﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace VgoCardChange
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //routes.MapRoute(
            //    "Logout", // Route name
            //    "User/Logout", // URL with parameters
            //    new { controller = "User", action = "Logout" } // Parameter defaults
            //);
            //routes.MapRoute(
            //    "Default", // Route name
            //    "{controller}/{action}", // URL with parameters
            //    new { controller = "Home", action = "Index" } // Parameter defaults
            //);
            routes.MapRoute(
                "CardBill", // user register
                "CardBill/Charging", // URL with parameters
                new { controller = "CardBill", action = "CardBill" } // Parameter defaults
            );
            routes.MapRoute(

                "SaveDiscount", //log in with Admin account
                "SaveDiscount", // URL with parameters
                new { controller = "Admin", action = "SaveDiscount" } // Parameter defaults
            );
            routes.MapRoute(
                "Admin Login", //log in with Admin account
                "AdminLogin", // URL with parameters
                new { controller = "Admin", action = "Login" } // Parameter defaults
            );
             routes.MapRoute(
                "ActiveDisCount", //Create discount event
                "Admin/ActiveDisCount", // URL with parameters
                new { controller = "Admin", action = "ActiveDisCount" } // Parameter defaults
            );
            routes.MapRoute(
                "AdminLogout", // Route name
                "Admin/Logout", // URL with parameters
                new { controller = "Admin", action = "AdminLogout" } // Parameter defaults
            );
            routes.MapRoute(
                "Admin", // Admin login page
                "Admin", // URL with parameters
                new { controller = "Admin", action = "Admin" } // Parameter defaults
            );
            routes.MapRoute(
                "Register", // user register
                "Register", // URL with parameters
                new { controller = "User", action = "Register" } // Parameter defaults
            );
            routes.MapRoute(
                "Logout", // Route name
                "User/Logout", // URL with parameters
                new { controller = "User", action = "Logout" } // Parameter defaults
            );
            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}", // URL with parameters
                new { controller = "User", action = "Login"} // Parameter defaults
            );

        }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }
    }
}